package com.mycompany.app.hr.eleave.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.apache.commons.lang.builder.ToStringBuilder;

/**
 * 保存/跟踪员工Annual leave, sick leave天数情况 Pre-Conditions Leave entitlement has been
 * generated after the employee info imported. current defect:daemon
 * job[LEAVE_ROLLOVER_MONTHLY] 增加了系统复杂性. AL Balance this year=AL Balance last
 * year+Al entited +[AL Credit]-AL Consumed-[shutdown consumed]+[shutdown
 * replacement]-AL Applied
 * 
 * @author Shawn.guo
 */
@Entity 
@Table(name = "eleave_leave_entitlement")
public class LeaveEntitlement {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "leave_entitlement_id")
    private Long id;

    @Column(name = "gid")
    private String empGID;

    @Column(name = "entitlement_year")
    private Integer entitlementYear;

    // accrual every month,none deduct.
    @Column(name = "annual_leave_entitled")
    private Float annualLeaveEntitled;

    @Column(name = "sick_leave_entitled")
    private Float sickLeaveEntitled;

    /**
     * when leave date is due, leave days will be added to consumed field.
     */
    @Column(name = "annual_leave_consumed")
    private Float annualLeaveConsumed;

    @Column(name = "sick_leave_consumed")
    private Float sickLeaveConsumed;

    /**
     * when leave date is due, leave days will be deducted from applied field.
     */
    @Column(name = "annual_leave_applied")
    private Float annualLeaveApplied;

    @Column(name = "sick_leave_applied")
    private Float sickLeaveApplied;

    @Column(name = "is_active")
    private boolean isActive;

    /**
     * deduct when apply leave, add when cancel/delete leave.
     */
    // private Float slApplied;
    // private Float alApplied;
    // /*========================*/
    //    
    //    
    // private Float slConsumed;
    // private Float alConsumed;
    //    
    // private boolean isActive;
    // =======================================================
    @Override
    public String toString() {

        return ToStringBuilder.reflectionToString(this);
    }

    // =======================================================

    public Long getId() {

        return id;
    }

    public void setId(Long id) {

        this.id = id;
    }

    public String getEmpGID() {

        return empGID;
    }

    public void setEmpGID(String empGID) {

        this.empGID = empGID;
    }

    public Integer getEntitlementYear() {

        return entitlementYear;
    }

    public void setEntitlementYear(Integer entitlementYear) {

        this.entitlementYear = entitlementYear;
    }

    public Float getAnnualLeaveEntitled() {

        return annualLeaveEntitled;
    }

    public void setAnnualLeaveEntitled(Float annualLeaveEntitled) {

        this.annualLeaveEntitled = annualLeaveEntitled;
    }

    public Float getSickLeaveEntitled() {

        return sickLeaveEntitled;
    }

    public void setSickLeaveEntitled(Float sickLeaveEntitled) {

        this.sickLeaveEntitled = sickLeaveEntitled;
    }

    public Float getAnnualLeaveConsumed() {

        return annualLeaveConsumed;
    }

    public void setAnnualLeaveConsumed(Float annualLeaveConsumed) {

        this.annualLeaveConsumed = annualLeaveConsumed;
    }

    public Float getSickLeaveConsumed() {

        return sickLeaveConsumed;
    }

    public void setSickLeaveConsumed(Float sickLeaveConsumed) {

        this.sickLeaveConsumed = sickLeaveConsumed;
    }

    public Float getAnnualLeaveApplied() {

        return annualLeaveApplied;
    }

    public void setAnnualLeaveApplied(Float annualLeaveApplied) {

        this.annualLeaveApplied = annualLeaveApplied;
    }

    public Float getSickLeaveApplied() {

        return sickLeaveApplied;
    }

    public void setSickLeaveApplied(Float sickLeaveApplied) {

        this.sickLeaveApplied = sickLeaveApplied;
    }

    public boolean isActive() {

        return isActive;
    }

    public void setActive(boolean isActive) {

        this.isActive = isActive;
    }
}
